package chapter5.section3;

//程序5-5：一个能够对账户进行转账的程序
public class BankService {
	// 转账业务，从src向dest对象转amount
	public void transfer(Account0504 src, Account0504 dest, int amount) {
		src.withdraw(amount);
		dest.deposit(amount);
	}

	public static void main(String[] args) {
		Account0504 a1 = new Account0504("001", "鲁宁", 1000);
		Account0504 a2 = new Account0504("002", "梁丽", 800);
		BankService bs = new BankService();
		bs.transfer(a1, a2, 100);
		System.out.println("鲁宁还有" + a1.getBalance());
		System.out.println("梁丽还有" + a2.getBalance());
	}
}  
